"""
@Project:大鹏
@File:models.sql
@Author:马可
@Date:上午 10:29
"""
from flask_sqlalchemy import SQLAlchemy
from _datetime import datetime

db = SQLAlchemy()

class Garden(db.Model):
    id = db.Column(db.Integer,primary_key=True,autoincrement=True,comment="菜园ID")
    name = db.Column(db.String(32),comment="菜园名称")
    start_temp = db.Column(db.String(32),comment="菜园最低温度")
    end_temp = db.Column(db.String(32),comment="菜园最高温度")
    start_humidity = db.Column(db.String(32),comment="菜园最低湿度")
    end_humidity = db.Column(db.String(32),comment="菜园最高湿度")


class Accident(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment="事故ID")
    start_time = db.Column(db.DateTime,default=datetime.now,comment="故障时间")

